/*
 * H265RtpPacker.h
 *
 *  Created on: 2018年4月21日
 *      Author: chuanjiang.zh@qq.com
 */

#ifndef H265RTPPACKER_H_
#define H265RTPPACKER_H_

#include "RtpPacker.h"
#include "ByteBuffer.h"

namespace av
{

class H265RtpPacker: public RtpPacker
{
public:
	H265RtpPacker();
	virtual ~H265RtpPacker();

	virtual bool open();

	virtual void pack(const MediaPacket& pkt, int maxSize, RtpPackerSink sink);

	virtual void close();

protected:

    void sliceNaluPtr(uint8_t* data, uint8_t* end, uint32_t timestamp, bool mark,
            int maxSize, RtpPackerSink sink);

    void sliceNalu(uint8_t* data, int size, uint32_t timestamp, bool mark,
        int maxSize, RtpPackerSink sink);

protected:
	ByteBuffer	m_buffer;

};

} /* namespace av */

#endif /* H265RTPPACKER_H_ */
